<!DOCTYPE html>
<html>
    <head>
        <style>
            body{
                border: 1px solid black;
            }

            .left{
                float: left;
                width: 300px;
                background-color: aqua;
                height: 200px;
            }

            .right{
                margin-left: 310px;
                background-color: antiquewhite;
                height: 200px;
            }

        </style>
    </head>
    <body>
        <div class="left">左边使用float定宽</div>
        <div class="right">右边使用margin实现自适应宽度</div>
    </body>
</html>